package cn.com.sqlinterface;
/**
 * 用来保存s数据库查询时需要用到的sql语句
 * @author zjthinkpad
 *
 */
public interface SQLInterface 
{
	//查询桌子的信息
	String INIT_TABLE ="select tid, tname, ttype, svid, tseat, tviewer, tplayer, tmax, tminbet,minbuy,maxbuy, tstatus from `ttable` where tid =?";
	
	
    //(`uid`, `pfid`, `tid`, `olkey`, `olstatus`, `oltime`, `olsumtime`)
	//在关联表里面插入一条记录
	String INSER_REF_RECOD="update online set olstatus=?,tid=? where uid=? and olkey=?";
	String UPDATE_TABLE_COME="update ttable set tviewer = tviewer + ? where tid = ?";
	
	
	//用户坐下成功，改变这个用户和桌子关联的表
	String SEAT_SUCCESS = "update online set olstatus = 2 where uid = ? and olkey=?";
	String UPDATE_TABLE_SEAT="update ttable set tviewer=tviewer-1,tplayer=tplayer+1 where tid=?";
	
    //`usergame` (`uid`, `uchip`, `ulevel`, `uexp`, `utime`, `uvip`, `ugift`, `uldays`, `uscore`, `ustatus`, `ugtime`)
	//查询用户的所有信息，用来初始化用户
	String INIT_USER="select uid,uchip,ulevel,uexp,utime,uvip,ugift,uldays,uscore,ustatus,ugtime from usergame where uid=?";
	
	//用户离开
	String USER_OUT = "update online set olstatus = 0 where uid = ?";
	String USER_SEAT_OUT="update ttable set tplayer=tplayer-1 where tid=?";
	String USER_WATCH_OUT="update ttable set tviewer=tviewer-1 where tid=?";
	
	//用户站起
	//String USER_STAND = "update table_user_ref set User_State = 0 where user_id = ?";
	String USER_STAND = "update online set olstatus = 1 where uid = ?";
	String UPDATE_TABLE_LEAVE="update ttable set tviewer=tviewer+1,tplayer=tplayer-1 where tid=? ";
	
	//
	String BACK_ALL_MONEY = "update usergame set uchip=?  where uid = ?";
	
	//查询用户的总钱数
	String SELECT_ALL_MEONEY = "select uchip from usergame where uid = ?";
	
	//在用户初始化之前执行用户信息的更新
	String UPDATE_USERMONEY="update usergame set uchip=? where uid=?";
	
	//查找是不是已经登陆
	String SLECT_COUNT = "select count(*) from online where uid=?";
	
	//查询出所有的用户信息
	String SELECT_ALL = "select * from usergame";
	
	//将用户的钱返回到数据库里面
	String BACK_USER_MONEY = "update usergame set uchip =? where uid =?";
	
	
	
	
	
	//给用户增加经验值
	String ADD_CHARMVALUE = "update usergame set uexp = uexp+? where uid = ?";
	//检查用户是不是在关联列表里面
	String CHECK_USER = "select count(*) from online where uid =?";
	//将用户的钱减去进入VIP场要付出的代价、
	//String DEDCUT_VIP = "update poke_user set USER_ALL_MONEY = USER_ALL_MONEY-? where user_id = ?";
	//String DEDCUT_VIP = "update poke_user set user_all_money = user_all_money-? where user_id = ?";
	

}
